/*
 *	Copyright © 2013 Changsha Shishuo Network Technology Co., Ltd. All rights reserved.
 *	长沙市师说网络科技有限公司 版权所有
 *	http://www.shishuo.com
 */

package com.hlingsoft.kkh.dao;

import com.hlingsoft.kkh.entity.Image;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

/**
 * 用户服务
 *
 * @author Zhang jiale
 *
 */

@Repository
public interface ImageDao {



	/**
	 * 添加图片
	 *
	 * @param image
	 * @return Integer
	 */
	public long addImage(Image image );


	/**
	 * 通过地址找到图片记录
	 * @param path
	 * @return
	 */
	public Image getImageByPath(@Param("path") String path);

	/**
	 * 更新图片（删除图片）
	 * @param image
	 * @return
	 */
	public int updateImage (Image image);

	/**
	 * 获取events的图片
	 * @param eventsId
	 * @return
	 */
	public List<Image> getImageByEventsId(@Param("eventsId") long eventsId );



	public List<Image> getImageByEventsIdWithNone(@Param("eventsId") long eventsId );


	public long getImageByEventsIdCount(@Param("eventsId") long eventsId );

	/**
	 * 获取eventComments的图片
	 * @param eventCommentsId
	 * @return
	 */
	public List<Image> getImageByEventCommentsId(@Param("eventCommentsId") long eventCommentsId );


	public List<Image> getImageByEventCommentsIdWithNone(@Param("eventCommentsId") long eventCommentsId );

	/**
	 * 根据eventCommentsId查询图片数量
	 * @param eventCommentsId
	 * @return
	 */
	public long getImageByEventCommentsIdCount(@Param("eventCommentsId") long eventCommentsId );

	/**
	 * 获取12小时内插入最多的图片的events
	 * @return
	 */
	public List<Image> getHotEventsId();

	/**
	 * 根据id查找图片
	 * @param id
	 * @return
	 */
	public Image getImageById(@Param("id") long id);



	public List<Image> getImageByAppUserId(@Param("appUserId") long appUserId );

	/**
	 * 用户相关图片
	 * @param appUserId
	 * @return
	 */
	public List<Image> getImageByAppUserIdWithNone(@Param("appUserId") long appUserId );


}
